package com.game.server.message.proto.execute;

import java.util.ArrayList;

import com.comm.ISession;
import com.game.majiang.logic.LogicClient;
import com.game.majiang.logic.LogicServer;
import com.game.majiang.logic.LogicTable;
import com.game.server.message.proto.in.AbstractChatStringReq;
import com.game.server.message.proto.out.ChatStringRsp;

public class ChatStringReq extends AbstractChatStringReq {

    @Override
    public void Execute(ISession session) {
        LogicClient client = (LogicClient) LogicServer.getInstance().getClient(session.getId());
        if (client != null&&client.checkClick(msgcode)) {
            if(client.getTable() != null) {
            	LogicTable table = (LogicTable) client.getTable();
            	ArrayList<String> listChat = table.getListChat();
            	ChatStringRsp rsp = new ChatStringRsp();
            	rsp.setStrs(listChat.toArray(new String[listChat.size()]));
            	client.Send(rsp);
            }
        }
    }

}
